 <meta charset="utf-8">
 <div class="box" id="biz_authApp_conatainer">
            <div class="box-header with-border">
               <form id="searchForm" role="form" class="form-inline">
                    <div class="form-group">
                         <label>应用编号</label>
                         <input name="appkey" type="text" placeholder="" class="form-control">
                    </div>
                     <div class="form-group">
                    <label>应用名称</label>
                      <input name="name" type="text" placeholder="" class="form-control">    
                    </div>
					<button type="button" class="btn btn-info pull-right m-t-n-xs" onclick="search();"><strong>查询</strong></button>
                </form>
            </div>
 <div class="box-body">
 	                           <div class="btn-group " id="authAppTableToolbar" role="group">
 	                            A<select v-model="selecteda.ad" class=" form-control">  
								  <option v-for="option in xxoptions" v-bind:value="option.value">  
								    {{ option.text }}  
								  </option>  
								</select><!-- v-zsselect="static/select.json"  -->
								B:
								<select v-model="selecteda.ad" v-kselect="{url:'static/select.json',vmodel:'selecteda.ad'}" class=" form-control"> </select>
								<select v-model="selectedB" v-kselect="{url:'static/select.json',vmodel:'selectedB'}" multiple="multiple" class=" form-control"> </select>
								
                                    <button type="button" v-kperms="{perm:''}"  class="btn btn-default" onclick="add();">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 添加
                                    </button>
                                    
                                     <button type="button"  class="btn btn-default" onclick="edit();">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> 修改
                                    </button>
                                  
                                    <button type="button"  class="btn btn-default" onclick="deleteauthApp();">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i> 删除
                                    </button>
                           </div>
           <table id="authAppBootstrapTable" data-mobile-responsive="true" ></table>
 </div> 
</div>
<script>

var jqTableDom=$("#authAppBootstrapTable");
new Vue({  
	 el: '#biz_authApp_conatainer',  
	  data: {  
	    selected: 'B', 
	    selectedxx: 'BB',
	    selecteda:{ad: 'CC'},
	    selectedB:['CC','BB'],
	     url:"auth/authApp/loadAuthAppList",
	     columns=[
			{checkbox:true},
			{field:'appkey',title:'应用编号',width:100,sortable:true},
			{field:'name',title:'应用名称',width:160},
			{field:'icon',title:'图标',width:60},
			{field:'appDomain',title:'域名',width:120},
			{field:'enabled',title:'状态',width:60},
			{field:'remark',title:'备注',width:60}
		],
	    xxoptions: [  
	      { text: 'One', value: 'A' },  
	      { text: 'Two', value: 'B' },  
	      { text: 'Three', value: 'C' }  
	    ],
	    axxoptions: [  
		      { text: 'One', value: 'AA' },  
		      { text: 'Two', value: 'BB' },  
		      { text: 'Three', value: 'CC' }  
		    ] 
	  },
	    beforeMount: function () {
            console.group('beforeMount 挂载前状态===============》');
            console.log("%c%s", "color:red","el     : " + (this.$el)); //已被初始化
            console.log(this.$el);
               console.log("%c%s", "color:red","data   : " + this.$data); //已被初始化  
               console.log("%c%s", "color:red","message: " + this.message); //已被初始化  
              
        },
	  mounted:function(){
		  console.log("mounted:function");
		 initData();
		  alert("");
	  }
	 /*  ready:function(){//load data,
		  console.log("ready:function");
		  initData();
		  this.xxoptions= [  
		      { text: 'OneA', value: 'A' },  
		      { text: 'TwoB', value: 'B' },  
		      { text: 'ThreeC', value: 'C' }  
		    ]
 		}, */
});
$(function(){
	//initData();
});
function initData(){
	var columns=[
				{checkbox:true},
				{field:'appkey',title:'应用编号',width:100,sortable:true},
				{field:'name',title:'应用名称',width:160},
				{field:'icon',title:'图标',width:60},
				{field:'appDomain',title:'域名',width:120},
				{field:'enabled',title:'状态',width:60},
				{field:'remark',title:'备注',width:60}
			];
	var url="auth/authApp/loadAuthAppList";
	bstable=zfesBstable.laodTable($("#authAppBootstrapTable"),$("#searchForm"),$("#authAppTableToolbar"),url,columns);
}

function search(){
	zfesBstable.reload(jqTableDom);
}
function add(){
	 var url="/view/auth/authApp/authApp.add.html";
	 zfesLayerEditDg.open(url,{},"用户编辑",460,function(){zfesBstable.refresh(jqTableDom);});
}
 function edit(){
	 if(zfesBstable.isOneRow(jqTableDom)){
		 var id=zfesBstable.getRowId(jqTableDom);
		 var url="/view/auth/authApp/authApp.edit.html";
		 zfesLayerEditDg.open(url,{"id":id},"用户编辑",600,function(){zfesBstable.refresh(jqTableDom);}); 
	 }
 }
 
 function deleteauthApp(){
	 if(zfesBstable.isOneRow(jqTableDom)){
			if(zfesBstable.isOneRow(jqTableDom)){
				var id=zfesBstable.getRowId(jqTableDom);
				 alertSwal.confirm("删除","是否删除该应用",function(){
				       layer.close(layer.index);
					 	var ajaxUrl = "auth/authApp/deletAuthApp";
						var param = { "id" : id};
						zfesAjax.ajaxTodo(ajaxUrl, param, function(data) {
							alertSwal.successText(data.message);
			 			     layer.close(layer.index);
			 			    zfesBstable.refresh(jqTableDom);
						}); 
			});
				}
			
		}
 }
</script>

<script type="text/javascript">

	

</script>
